﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;
namespace Bug_Speed
{
    public partial class FrmTest : Form
    {
        public FrmTest()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            EventProcessArg epr = new EventProcessArg();
            
            epr.CurrentProcessStepsNumber  = 1;
            epr.Maximum = 2000;
            epr.Minimum = 0;

            ProcessEventSource pe = new ProcessEventSource();

            ProcessBar pb = new ProcessBar(pe);

            pb.Show();
            
            for (int i = 0; i < 2000; i++)
            {
                epr.CurrentProcessStepsNumber = i;
                Thread.Sleep(1);
                pe.OnEventCurrentSteps(epr);
            }
            Application.DoEvents();
            pb.Hide();
            pb.Dispose();
            
        }
    }
}
